package string;

import java.util.Scanner;


public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "www.baidu.com";
        System.out.println(str.startsWith("w"));
        System.out.println(str.startsWith("baidu", 4));
        System.out.println(str.endsWith(".cn"));
        System.out.println(str.endsWith(".com"));
        System.out.println(str);
        String code = "123sdDs";
        Scanner SC = new Scanner(System.in);
        System.out.println(code);
        String input = SC.nextLine();
        if (code.equalsIgnoreCase(input)) {
            System.out.println("正确");
        } else {
            System.out.println("错误");
        }
        SC.close();

        boolean a = true;
        String b = new String(String.valueOf("123".charAt(1)));
        String S = str + b;
        System.out.println(S);
    }
}
